export default {
  requestLibPath: "import request from '@/request'",
  schemaPath: 'http://localhost:8123/api/v3/api-docs',
  serversPath: './src',
  hook: {
    // 将后端@Tag(name="用户管理-User")提取出来User命名
    customFileNames: (operationObject, apiPath) => {
      const tags = operationObject.tags[0];
      if (!tags) {
        // @ts-ignore
        console.warn("[Warning] no tags", apiPath);
        return;
      }
      const res = tags.split("-");
      if (res.length > 1) {
        res.shift();
        if (res.length > 2) {
          // @ts-ignore
          console.warn("[Warning]  tags has more than 2 part", apiPath);
        }
        return [res.join("_")];
      } else {
        const controllerName = (res || [])[0];
        if (controllerName) {
          return [controllerName];
        }
        return;
      }
    },
  },
}
